#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2020/8/9 11:27|11:27
# @Author  : yangdingyi
# @File    : 2020-08-09.5471.和为目标值的最大数目不重叠非空子数组数目
# @Software: PyCharm
from tools.my_methods import *


class Solution:
    def maxNonOverlapping(self, nums: List[int], target: int) -> int:
        ans = 0
        if not nums:
            return ans
        sums = [nums[0]]
        ln = len(nums)
        for i in range(1, ln):
            sums.append(sums[i-1]+nums[i])
        print(nums)
        print(sums)

        return ans


questions = [
    ([1, 1, 1, 1, 1], 2),
    ([-1, 3, 5, 1, 4, 2, -9], 6),
]

work(questions, lambda q: Solution().maxNonOverlapping(q[0], q[1]))
